<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Symbol类型</title>
</head>
<body>
    
</body>
</html>

<script>
    // 为什么要有 Symbol？
    // 1.Symbol() 方法的使用
    let sy1 = Symbol()
    let sy2 = Symbol('123')
    // console.log('sy1:', typeof sy1)
    // console.log('sy2:', sy2.description)
    let sy3 = Symbol.for('123')
    let sy4 = Symbol.for('123')
    console.log(sy3 === sy4)
</script>